package cn.shyouchi.wuguanjia.android.ui.workshow;

import android.view.WindowManager;
import android.widget.VideoView;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.shyouchi.wuguanjia.android.R;
import cn.shyouchi.wuguanjia.android.base.BaseActivity;
import mabeijianxi.camera.util.StringUtils;

public class VideoShowPlayerActivity extends BaseActivity {


    @BindView(R.id.video_view)
    VideoView mVideoView;

    /**
     * 播放路径
     */
    private String mPath;

    @Override
    public int initContentView() {
        return R.layout.activity_video_show_player;
    }

    @Override
    public void initInjector() {
        // 防止锁屏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

        mPath = getIntent().getStringExtra("path");
        if (StringUtils.isEmpty(mPath)) {
            finish();
            return;
        }
    }

    @Override
    public void initUiAndListener() {
        ButterKnife.bind(this);


        mVideoView.setVideoPath(mPath);

        mVideoView.start();

    }

    @Override
    protected boolean isApplyStatusBarTranslucency() {
        return false;
    }

    @Override
    protected boolean isApplyStatusBarColor() {
        return true;
    }


}
